#create new user
useradd <myusername>

#add user to mail server
vim /etc/postfix/virtual
myusername@domain myusername

postmap /etc/postfix/virtual

vim /etc/postfix/main.cf
virtual_alias_maps = hash:/etc/postfix/virtual

service postfix reload

vim /etc/postfix/master.cf 
myhook unix - n n - - pipe flags=F user=www-data argv=/path/to/script.sh ${sender} ${size} ${recipient}

postfix reload
chmod +rx script.sh


vim /etc/postfix/access
myusername@domain FILTER myhook:dummy

postmap /etc/postfix/access